const Koa = require('koa')
const app = new Koa()
const bodypasser = require('koa-bodyparser')//帮助koa解析post请求的参数
const index = require('./routers/index')
const user = require('./routers/user')
const diary = require('./routers/diary')//引入路由


//启用路由
app.use(bodypasser())
app.use(user.routes(),user.allowedMethods())
app.use(index.routes(),index.allowedMethods())
app.use(diary.routes(),diary.allowedMethods())
app.listen(3000,()=>{
    console.log('项目已启动');
})